<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<%= javascript_include_tag :defaults %>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>OSLP</title>
  <%= stylesheet_link_tag 'main' %>
</head>
<body>
<%= hidden_field_tag 'tags_list' , " " %>
<div id="header">
	<div id="navbar">
	<table border="0">
		<tr>
			<td><%= image_tag('/images/oslp-logo.png') %></td>
		<% if(!session[:user_id].nil?) %> 
		<% @user = User.find(session[:user_id]) %>
			<td><%= link_to 'Logout', :controller => "login", :action => "logout" %></td>
			<td><%= link_to 'Share', :controller=>"resources", :action=>"new" %></td>
			
			<td><%= link_to 'Resources', :action => 'index' , :controller => 'resources' %></td>
				</tr>
			</table>
			
		<p class="connected_user">Connected as: <%= @user.username %>
		
		<% else %>
				<td><%= link_to 'Sign in', :action => 'new' %> </td>
				<!-- LOGIN BOX //-->
				<td><%= link_to_remote "login", :controller=>'session', :update=>"accessbox",
 					:url => {:controller=>"login", :action => "showloginbox"}, 
					:success=>visual_effect(:highlight, "accessbox")%>	</td>
				<td><div id="accessbox" style=";width:200px;"></div></td>
				<!-- end LOGIN BOX //-->
		</tr>
		</table>
		<% end %>
		</div>
		
	<p style="color: green">
		<%= flash[:notice] %>
	</p>	
	<p style="color: red">
		<%= flash[:warning] %>
	</p>	
		
</div>
<div id="sidebar">
	<% if session[:user_id] then %>
<!--		<ul>
			<li><%= link_to 'My profile', :controller => 'users', :action => "edit" , :id => @user.id  %></li>
			<li><%= link_to 'My favorites', '#' %></li>
			<li><%= link_to 'My resources', :controller=>"resources", :action=>"resourcesofuser", :id=>session[:user_id] %><br></li>
			<li><%= link_to 'All users', '/users' %></li>
		</ul>
-->
		<%= link_to image_tag('/images/home3.png'), :controller=>"users", :action=>"start_page" %><br>
		<%= link_to 'My profile', :controller => 'users', :action => "edit" , :id => @user.id  %><br>
		<%= link_to 'My favorites', '#' %><br>
		<%= link_to 'My resources', :controller=>"resources", :action=>"resourcesofuser", :id=>session[:user_id] %><br>
		<%= link_to 'All users', '/users' %>
	<% else %>
		
	<% end %>
</div>
<div id="contents">
	<%= yield  %>
<div id="footer">
	
</div>

</body>
</html>
